// Lab2新增
// 开发时请解除3-4行的注释
import {axios} from '../utils/request'
import {STORE_MODULE} from './_prefix'

type storeCreateInfo = {
    name : string
    logoURL : string
    address : string
}

//在未登录的情况下获取所有商店信息
export const storeInfo = () => {
    return axios.get(`${STORE_MODULE}/info`)
        .then(res => {
            return res
        })
}

//创建商店
export const storeCreate = (storeCreateInfo: storeCreateInfo) => {
    return axios.post(`${STORE_MODULE}/create`,storeCreateInfo,
        {headers: {'Content-Type': 'application/json'}})
        .then(res => {
            return res
        })
}

//获取指定id的商店信息
export const singleStoreInfo = (storeId : number) => {
    return axios.post(`${STORE_MODULE}/info/single`, null, {params: {id:storeId}})
        .then(res => {
            return res
        })
}

